/*
* Copyright (C) 2021 ~ 2022 Uniontech Technology Co., Ltd.
*
* Author:      zhangbingyi <zhangbingyi@uniontech.com>
*
* Maintainer:  zhangbingyi <zhangbingyi@uniontech.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef USBSCANSETTINGDLG_H
#define USBSCANSETTINGDLG_H

#include "common/schedulescan/schedulescanitem.h"
#include "invokers/invokerfactory.h"
#include "gsettingkey.h"
#include "common.h"

//#include <DSuggestButton>
#include <QDialog>
#include <QFrame>
//#include <DBlurEffectWidget>
#include <QPushButton>

#include <QButtonGroup>
#include <QObject>
#include <QRadioButton>

#define PB_CANCLE_WIDTH 170 // 取消按钮宽度
#define PB_CANCLE_HEIGHT 36 // 取消按钮高度
#define LINE_HEIGHT 28 // 分割线高度

class HFrame1;

class DEVCOMMONSHARED_EXPORT USBScanSettingDlg : public QFrame
{
    Q_OBJECT
public:
    explicit USBScanSettingDlg(QWidget *parent = nullptr);

private:
    void initUi();
    void initData();
    void initConnection();

private Q_SLOTS:
    // USB扫描确定按钮设置槽
    void acceptConfirmButtonClicked();

    void setWidgetStatus(bool isEnabled);

    // USB扫描总开关状态改变槽
    void acceptUSBScanSwitchStatusChange();

private:
//    DBlurEffectWidget *m_blurEffect; // 透明背景
    HFrame1 *m_contentWidget; // 内容装置
    ScheduleScanItem *m_usbScanSettingItem; // USB扫描设置选项
    QButtonGroup *m_pFoundButtonGrop; // 扫描类型按钮组
    QRadioButton *m_askButton; // 询问按钮
    QRadioButton *m_autoButton; // 自动处理按钮
    QPushButton *m_pCancelBtn; // 取消按钮
    QFrame *m_line; // 分割线
    QPushButton *m_pConfirmBtn; // 确认按钮
    bool m_usbScanSwitch;
    int m_usbScanType;
    SettingsInvokerInterface *m_gsetting; // 安全中心gsetting配置
    DBusInvokerInterface *m_monitorInterFaceServer; // 流量监控dbus类
};

#endif // USBSCANSETTINGDLG_H
